# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=blackarch-menus
pkgver=10.5244eea
pkgrel=3
pkgdesc='BlackArch specific XDG-compliant menu.'
groups=('blackarch-config')
arch=('any')
url='https://github.com/BlackArch/blackarch-menus'
license=('custom:unknown')
depends=('xdg-utils')
makedepends=('git')
source=("git+https://github.com/BlackArch/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/etc/xdg/menus/applications-merged"
  install -dm 755 "$pkgdir/usr/share/$pkgname"
  install -dm 755 "$pkgdir/usr/share/desktop-directories"
  install -dm 755 "$pkgdir/etc/pacman.d/hooks"
  install -dm 755 "$pkgdir/etc/pacman.d/scripts"

  install -Dm 644 README.md "$pkgdir/usr/share/doc/$pkgname"
  install -m 644 menus/X-BlackArch.menu \
    "$pkgdir/etc/xdg/menus/applications-merged/"
  install -m 644 desktop-directories/*.directory \
    "$pkgdir/usr/share/desktop-directories/"

  install -m 755 pacman-hooks/*.sh "$pkgdir/etc/pacman.d/scripts"
  install -m 755 pacman-hooks/*.hook "$pkgdir/etc/pacman.d/hooks"
}

